package com.pos43.business.service.impl;

import java.util.List;

import com.pos43.business.dao.IProductTypeDao;
import com.pos43.business.dao.impl.ProductTypeDao;
import com.pos43.business.service.IProductTypeService;
import com.pos43.domain.ProductType;

public class ProductTypeService implements IProductTypeService{
	
	IProductTypeDao productTypeDao = new ProductTypeDao();
	
	public Integer addProductType(String ptname){
		ProductType productTypeInstance = new ProductType();
		productTypeInstance.setPtname(ptname);
		return productTypeDao.save(productTypeInstance);
	}
	
	 public void delProductType(Integer ptid){
		 productTypeDao.delete(ptid);
	 }
	 
	 public void updateProductType(ProductType productType){
		 productTypeDao.update(productType);
	 }
	 
	 public List<ProductType> listProductType(){
		 return productTypeDao.findAll();
	 }
	 
	 public ProductType getProductType(Integer ptid){
		 return productTypeDao.get(ptid);
	 }

	public IProductTypeDao getProductTypeDao() {
		return productTypeDao;
	}

	public void setProductTypeDao(IProductTypeDao productTypeDao) {
		this.productTypeDao = productTypeDao;
	}

	

}
